﻿using ASmile.Com;
using ASmile.Com.Da;
using ASmile.Com.Report;
using ASmile.DBModel;
using Microsoft.AspNetCore.Mvc;

namespace ASmile.Web.ApiControllers.SysManage
{
    /// <summary>
    /// GridView配置
    /// </summary>
    [Route("api/SysManage/[controller]/[action]")]
    [ApiExplorerSettings(GroupName = "SysManage")]
    public class ReportController : BaseApiCrudController<ReportBLL, Sys_ReportArg, ArgGetReport>
    {
        /// <summary>
        /// 根据 FormName 获取report主记录与明细记录
        /// </summary>
        [HttpPost]
        public ApiResult<RetVModel> GetVModel(ArgGetReport arg)
        {
            return BLLObj.GetVModel(arg);
        }
        /// <summary>
        /// 根据 FormName 获取report主记录
        /// </summary>
        [HttpPost]
        public ApiResultList<Sys_Report> GetReportList(ArgGetReport arg)
        {
            return BLLObj.GetReportList(arg);
        }
        /// <summary>
        /// 新增report主记录
        /// </summary>
        [HttpPost]
        public ApiResult<string> AddReport(Sys_Report model)
        {
            return BLLObj.AddReport(model);
        }
        /// <summary>
        /// 更新 report 主记录
        /// </summary>
        [HttpPost]
        public ApiResult<string> EditReport(Sys_Report model)
        {
            return BLLObj.EditReport(model);
        }
        [HttpPost]
        public ApiResult DelReport(string id)
        {
            return BLLObj.DelReport(id);
        }
        /// <summary>
        /// 修改指定列的排序
        /// </summary>
        [HttpPost]
        public ApiResult ChangeOrderNo(Sys_ReportArg model)
        {
            return BLLObj.ChangeOrderNo(model);
        }
        /// <summary>
        /// 交换两个行的排序
        /// </summary>
        [HttpPost]
        public ApiResult SwapOrderNo(ArgSwapOrderNo arg)
        {
            return BLLObj.SwapOrderNo(arg);
        }
        /// <summary>
        /// 获取报表数据
        /// </summary>
        [HttpPost]
        public ApiResult<RetReportData> GetReportData(ArgReportData arg)
        {
            return BLLObj.GetReportData(arg);
        }
        /// <summary>
        /// 获取打印报表数据
        /// </summary>
        [HttpPost]
        public ApiResult<RetPrintData> GetPrintData(ArgReportData arg)
        {
            return BLLObj.GetPrintData(arg);
        }
    }
}